<template>
<div>
  <h1>{{data}}</h1>
  <h1>{{data1}}</h1>
  <input type="text" v-model="data1"><button @click="addone">添加</button>
  <br>
  <button @click="add">跳转</button>
<!--  A页面跳转传参<router-link :to="{path:'/xiaologin',query:{userid:1}}">跳转1</router-link>-->
</div>

</template>

<script>
import axios from 'axios';
export default {
name: "lianxione"
,
  data(){
    return{
      id:3,
      data:'',
      data1:'',
    }
  },
  methods:{
    add(){
      this.$router.push({path:'/xiaologin',query:{userid:this.id}})
    },
    getdata(){
      axios({url:'http://127.0.0.1:5000/getdata',method:'get'}).then(res=>{
        console.log(res)
        this.data=res.data.list
      })
    },
    addone(){
      axios({url:'http://127.0.0.1:5000/getuser',method:'post',data:{userid:this.data1}}).then(res=>{
        console.log(res)
      })
    }
  },
  mounted() {
  this.getdata()
  }
}
</script>

<style scoped>

</style>